package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.common.dto.admin.StoreSaleListAndPageDto;
import com.frejoys.common.dto.store.StoreSaleListDto;
import com.frejoys.common.vo.admin.StoreStatisticsListVo;
import com.frejoys.common.vo.store.StoreStatisticsDayVo;
import com.frejoys.dao.entity.StoreStatisticsDay;

import java.util.List;

public interface StoreStatisticsDayService extends IService<StoreStatisticsDay> {

    default StoreStatisticsDay getOnly(QueryWrapper<StoreStatisticsDay> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default StoreStatisticsDay getOnly(LambdaQueryWrapper<StoreStatisticsDay> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    /**
     * 获取商家店铺统计
     */
    List<StoreStatisticsDayVo> getList(StoreSaleListDto dto, Long userId);

    //管理员查询店铺销售日统计列表
    IPage<StoreStatisticsListVo> storeStatisticsDayList(StoreSaleListAndPageDto dto);
}
